<template>
  <div id="cinema">
      <div class="nav">
          <span>全城 <i class="fa fa-caret-down"></i></span>
          <span>品牌 <i class="fa fa-caret-down"></i></span>
          <span>特色 <i class="fa fa-caret-down"></i></span>
      </div>
      <div>
          <ul>
              <li v-for="item in cinemaList" :key="item.id">
                  <p>
                    <span>{{item.name}}</span>
                    <span class="price">{{item.price}}</span>
                    <span class="price-desc">元起</span>
                  </p>
                  <p class="address">
                    <span>{{item.address}}</span>
                    <span>>{{item.distance}}km</span>
                  </p>
                  <p class="tips">
                    <span>小吃</span>
                    <span>折扣卡</span>
                   
                  </p>
              </li>
            
          </ul>
      </div>
  </div>
</template>

<script>
export default {
    name:'Cinema',
    methods:{
        getCinemaData(){
            var that=this
            axios.get('/mock/api.json')
            .then(function (response) {
                console.log(response);
                if(response.status==200&&reponse.data.cinemaList){
                    that.cinemaList=response.data.cinemaList
                }
            })
            .catch(function (error) {
                console.log(error);
            });
        }
    },
    created(){
        this.getCinemaData()
    },
    data(){
        return{
            cinemaList:[
                {"id":1,"name":"大地影院延庆金锣湾店","address":"延庆区北街39号H座首层","price":"38.5","distance":"100"},
                {"id":2,"name":"燕山影剧院","address":"房山区燕山岗南路3号","price":"37.5","distance":"120"},
                {"id":3,"name":"万达影城昌平保利光魔店","address":"昌平区鼓楼南街佳莲时代广场四层","price":"37.9","distance":"80"},
                {"id":4,"name":"门头沟影剧院","address":"门头沟区新桥大街12号","price":"30.9","distance":"110"}
]
        }
    }
}
</script>

<style scoped>
#cinema{
    padding-top: 50px;
    padding-bottom: 50px;
}
.nav span{
    width: 33%;
    display: inline-block;
    text-align: center;
    height: 45px;
    line-height: 45px;
}
.nav{
    border-bottom: 1px solid #ccc;
}
i{
    margin-left: 5px;
}
ul{
    padding: 0;
}
li{
    margin: 10px;
    border-bottom: 1px solid #ccc;
}
.price{
    color: #E54847;
    margin: 0 5px;
}
.price-desc{
    font-size: 12px;
    color: #E54847;
}
.address span{
    font-size: 12px;
    color: #999;
}
.tips{
    margin: 10px 0;
}
.tips span{
    border: 1px solid #f90;
    color: #f90;
}
</style>